package com.icangya.domain;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "admin")
public class Admin {

    private long id;//管理员编号
    /*
    * 管理员名称
    * */
    private String userName;
    /*
   * 管理员密码
   * */
    private String passWord;
    /*
      * 用户等级 0超级管理员 1管理员
      * */
    private  long gradeId;

    private long uid;//用户id


//代理的一些相关列

    /**
     * 所在的树形结构的层级数
     */
    private int userLevel;
    /**
     * 左侧的值
     */
    private int leftNum;
    /**
     * 右侧的值
     */
    private int rightNum;

    /**
     * 创建人的ID
     */
    private long userId;
    /**
     * 创建时间（时间戳格式）
     */
    private Timestamp createTime;








    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
    @Basic
    @Column(name = "user_name")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "password")
    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    @Basic
    @Column(name = "grade_id")
    public long getGradeId() {
        return gradeId;
    }

    public void setGradeId(long gradeId) {
        this.gradeId = gradeId;
    }

    @Basic
    @Column(name = "uid")
    public long getUid() {
        return uid;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }

    @Basic
    @Column(name = "user_level")
    public int getUserLevel() {
        return userLevel;
    }

    public void setUserLevel(int userLevel) {
        this.userLevel = userLevel;
    }

    @Basic
    @Column(name = "left_num")
    public int getLeftNum() {
        return leftNum;
    }

    public void setLeftNum(int leftNum) {
        this.leftNum = leftNum;
    }

    @Basic
    @Column(name = "right_num")
    public int getRightNum() {
        return rightNum;
    }

    public void setRightNum(int rightNum) {
        this.rightNum = rightNum;
    }

    @Basic
    @Column(name = "user_id")
    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }


    public Admin() {
    }

    public Admin(long id, String userName, String passWord, long gradeId,long uid) {
        this.id = id;
        this.userName = userName;
        this.passWord = passWord;
        this.gradeId = gradeId;
        this.uid = uid;
    }

    public Admin(String userName, String passWord, long gradeId, long uid, int userLevel, int leftNum, int rightNum, long userId, Timestamp createTime) {
        this.userName = userName;
        this.passWord = passWord;
        this.gradeId = gradeId;
        this.uid = uid;
        this.userLevel = userLevel;
        this.leftNum = leftNum;
        this.rightNum = rightNum;
        this.userId = userId;
        this.createTime = createTime;
    }
}
